home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / cat3 / access.3 < prev    next >
Encoding:
Text File  |  1993-03-03  |  1.6 KB  |  67 lines

  1.  
  2.  
  3.  
  4. ACCESS(3)           MINTLIB LIBRARY FUNCTIONS           ACCESS(3)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        access - determine accessibility of a file
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        #include <unistd.h>
  12.  
  13.        int access(const char *path, int amode);
  14.  
  15. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  16.        path  points  to  a  path naming a file. access checks the
  17.        named file for accessibility, using the real user  ID  and
  18.        real group ID of the process. The bit pattern contained in
  19.        amode is constructed as follows:
  20.          04: read
  21.          02: write
  22.          01: execute (search for directories)
  23.          00: check existence of file
  24.  
  25.        The owner of a file has permission checked with respect to
  26.        the  "owner" read, write and execute mode bits. Members of
  27.        the file's group other than  the  owner  have  permissions
  28.        checked  with  respect  to  the "group" mode bits, and all
  29.        others  have  permissions  checked  with  respect  to  the
  30.        "other" mode bits.  If the real user ID is 0 (super-user),
  31.        success is always returned for any existing file.
  32.  
  33. S✓SE✓EE✓E A✓AL✓LS✓SO✓O
  34.        c✓ch✓hm✓mo✓od✓d(✓(3✓3)✓),✓, s✓st✓ta✓at✓t(✓(3✓3)✓)
  35.  
  36. R✓RE✓ET✓TU✓UR✓RN✓N V✓VA✓AL✓LU✓UE✓ES✓S
  37.         0 if access is permitted.  -1 if access is not  permitted
  38.        or if the file does not exist;
  39.           errno is set to indicate the error.
  40.  
  41. N✓NO✓OT✓TE✓E
  42.        Under  TOS  or on a MS-DOS (TOS) file-system, this call is
  43.        pretty bogus and can best be used to check  for  existence
  44.        of the file.
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. MiNT docs 0.1              3 March 1993                         1
  65.  
  66.  
  67.